#include <libZebu.hh>
#include <exception>
#include <iostream>
#include <string.h>
#include <stdlib.h>

using namespace ZEBU;
using namespace std;

int main()
{
Board *board = NULL;
	try
		{
			//Open the board
			cout << "INFO: Opening zebu" <<endl;
			board = Board::open("../zcui.work");

			//Enable DPI calls
			CCall::LoadDynamicLibrary(board, "../dpi.so");
			CCall::SelectSamplingClocks(board, "clk");
			CCall::Start(board);
			
			board->init(NULL);
			
			while(1){
				board->serviceLoop();
			}
			CCall::Stop(board);
		}
	catch (exception &excp) {
		cerr << "Exception trapped : " << excp.what() << endl;
	} 
}
